home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Palettes / CustomMenuPalette / CustomMenu / CustomMenuInspector.m < prev    next >
Text File  |  1995-09-13  |  2KB  |  98 lines

  1.  
  2. //
  3. // Source file      : CustomMenuInspector.m
  4. // Created by       : gideon@berd
  5. // Created on       : Fri Sep 8 09:40:53 NZST 1995
  6. // RCS File         : $Source: /Ramoth/Black.Albatross/CVS/CustomMenu/CustomMenuInspector.m,v $
  7. // Last modified    : $Date: 1995/09/10 22:38:00 $
  8. // Last modified by : $Author: gideon $
  9. // Current Revision : $Revision: 1.1.1.1 $
  10. //
  11.  
  12. static const char RCSId[] = "$Id: CustomMenuInspector.m,v 1.1.1.1 1995/09/10 22:38:00 gideon Exp $";
  13.  
  14.  
  15. #import "CustomMenuInspector.h"
  16. #import "CustomMenu.subproj/DraggableMenu.h"
  17. #import "CustomMenu.subproj/CustomMenu.h"
  18.  
  19. @implementation DraggableMenu(IBSupport)
  20.  
  21. - (const char *)getInspectorClassName
  22. {
  23.     return "CustomMenuInspector";
  24. }
  25.  
  26. - (NXImage *)getIBImage
  27. {
  28.     id    idBundle;
  29.     id    idImage;
  30.     char buf[MAXPATHLEN + 1];
  31.     
  32.     idBundle = [NXBundle bundleForClass:[CustomMenuInspector class]];
  33.     [idBundle getPath:buf forResource:"CustomMenu" ofType:"tiff"];
  34.     idImage = [[NXImage alloc] initFromFile:buf];
  35.     
  36.     return idImage;
  37. }
  38.  
  39. @end
  40.  
  41. @implementation CustomMenuInspector
  42.  
  43. - (const char *)version
  44. {
  45.     return RCSId;
  46. }
  47.  
  48. - init
  49. {
  50.     char buf[MAXPATHLEN + 1];
  51.     id bundle;
  52.     
  53.     [super init];
  54.     
  55.     bundle = [NXBundle bundleForClass:[DraggableMenu class]];
  56.     [bundle getPath:buf 
  57.             forResource:"CustomMenuInspector" 
  58.             ofType:"nib"];
  59.     [NXApp loadNibFile:buf 
  60.            owner:self 
  61.            withNames:NO 
  62.            fromZone:[self zone]];
  63.     return self;
  64. }
  65.  
  66. - ok:sender
  67. {
  68.     [object setSaveAndRestore:([saveAndRestoreSwitch intValue]) ? YES : NO];
  69.     return [super ok:sender];
  70. }
  71.  
  72. - revert:sender
  73. {
  74.     [saveAndRestoreSwitch setIntValue:([object getSaveAndRestore]) ? 1 : 0];
  75.     return [super revert:sender];
  76. }
  77.  
  78. - (BOOL)wantsButtons        // We don't want the Ok and Revert buttons displayed
  79. {
  80.     return NO;
  81. }
  82.  
  83. - awakeFromNib
  84. {
  85.     id idBundle = [NXBundle bundleForClass:[self class]];
  86.     NXImage *image;
  87.     char buf[MAXPATHLEN+1];
  88.             
  89.     [idBundle getPath:buf forResource:"CustomMenu" ofType:"tiff"];
  90.     image = [[NXImage alloc] initFromFile:buf];
  91.     [iconButton setImage:image];
  92.     
  93.     [saveAndRestoreSwitch setIntValue:1];
  94.     return self;
  95. }
  96.  
  97. @end
  98.